home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / Catalog Service Access Module / DTS Sample CSAM / Src / DETUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-24  |  4.7 KB  |  217 lines  |  [TEXT/KAHL]

  1. /*
  2.  * DETUtilities.h
  3.  * Copyright © 1992 Apple Computer Inc. All Rights Reserved.
  4.  *
  5.  * This is a collection of utility functions that simplify
  6.  * programming OCE Directory Templates (DSAM) files. They
  7.  * provide access to template properties and a few other
  8.  * common bits of information.
  9.  */
  10. #ifndef __DETUtilities__
  11. #define __DETUtilities__
  12.  
  13. #include <OCETemplates.h>
  14. #if TRUE != 1
  15. #define TRUE        1
  16. #define FALSE        0
  17. #endif
  18.  
  19. /*
  20.  * Add an item to the template menu.
  21.  *        property                ??
  22.  *        parameter                ??
  23.  *        text                    Menu text
  24.  *        isSeparator                TRUE if adding a ---- mark
  25.  */
  26. pascal OSErr                AddToMenu(
  27.         DETCallBlockPtr            callBlockPtr,
  28.         short                    property,
  29.         short                    parameter,
  30.         RString                    *text,
  31.         Boolean                    isSeparator
  32.     );
  33.  
  34. /*
  35.  * Add/change an item to the template property database.
  36.  *        property                The property to add
  37.  *        newValue                A pointer to the datum
  38.  *        newValueSize            The size of the datum
  39.  *        markAsChanged            Mark database "changed"
  40.  * This function does the actual database manipulation.
  41.  * Normally, programs call SetBinaryProperty, SetNumProperty,
  42.  * or SetRStringProperty to set particular data types.
  43.  */
  44. pascal OSErr                SetPropertyCommon(
  45.         DETCallBlockPtr            callBlockPtr,
  46.         DETCallFunctions        function,
  47.         short                    property,
  48.         void                    *newValue,
  49.         Size                    newValueSize,
  50.         Boolean                    markAsChanged
  51.     );
  52.  
  53. /*
  54.  * Add/change a numeric property.
  55.  * See SetPropertyCommon for the common parameters.
  56.  *        newValue                The property value.
  57.  */
  58. pascal OSErr                SetNumProperty(
  59.         DETCallBlockPtr            callBlockPtr,
  60.         short                    property,
  61.         long                    newValue,
  62.         Boolean                    markAsChanged
  63.     );
  64.  
  65. /*
  66.  * Add/change a binary (untyped) property.
  67.  * See SetPropertyCommon for the common parameters.
  68.  *        newValue                -> the new datum
  69.  *        newValueSize            Datum size
  70.  */
  71. pascal OSErr                SetBinaryProperty(
  72.         DETCallBlockPtr            callBlockPtr,
  73.         short                    property,
  74.         Ptr                        newValue,
  75.         Size                    newValueSize,
  76.         Boolean                    markAsChanged
  77.     );
  78.  
  79. /*
  80.  * Add/change a RString property.
  81.  * See SetPropertyCommon for the common parameters.
  82.  *        newValue                The new string contents
  83.  */
  84. pascal OSErr                SetRStringProperty(
  85.         DETCallBlockPtr            callBlockPtr,
  86.         short                    property,
  87.         RString                    *newValue,
  88.         Boolean                    markAsChanged
  89.     );
  90.  
  91. /*
  92.  * Return the value of a numeric property
  93.  *        result                    Address of the desired value
  94.  */
  95. pascal OSErr                GetNumProperty(
  96.         DETCallBlockPtr            callBlockPtr,
  97.         short                    property,
  98.         long                    *result
  99.     );
  100.  
  101. /*
  102.  * Return the value of an untyped property
  103.  *        result                    Gets a handle to the desired value
  104.  */
  105. pascal OSErr                GetBinaryProperty(
  106.         DETCallBlockPtr            callBlockPtr,
  107.         short                    property,
  108.         Handle                    *result
  109.     );
  110.  
  111. pascal OSErr                GetBinaryPropertySize(
  112.         DETCallBlockPtr            callBlockPtr,
  113.         short                    property,
  114.         Size                    *size
  115.     );
  116.  
  117. /*
  118.  * Return the value of a RString property
  119.  *        result                    Gets a pointer to the RString value
  120.  */
  121. pascal OSErr                GetRStringProperty(
  122.         DETCallBlockPtr            callBlockPtr,
  123.         short                    property,
  124.         RString                    ***result
  125.     );
  126.  
  127. /*
  128.  * Mark property "dirty"
  129.  */
  130. pascal OSErr                DirtyProperty(
  131.         DETCallBlockPtr            callBlockPtr,
  132.         short                    property
  133.     );
  134.  
  135. /*
  136.  * Mark property "changed" if the flag is TRUE.
  137.  */
  138. pascal OSErr                SetPropertyChanged(
  139.         DETCallBlockPtr            callBlockPtr,
  140.         short                    property,
  141.         Boolean                    isPropertyChanged
  142.     );
  143.  
  144. /*
  145.  * Return a pointer to the DSSSpec for this template
  146.  */
  147. pascal OSErr                GetMyDSSpec(
  148.         DETCallBlockPtr            callBlockPtr,
  149.         short                    *refNum,
  150.         PackedDSSpec            ***pDsSpec
  151.     );
  152.  
  153. /*
  154.  * Get the number of items selected by the user.
  155.  */
  156. pascal OSErr                GetNumSelectedItems(
  157.         DETCallBlockPtr            callBlockPtr,
  158.         long                    *result
  159.     );
  160.  
  161. /*
  162.  * GetNthSelectedItem allows the program to iterate
  163.  * through the items selected by a user.
  164.  */
  165. pascal OSErr                GetNthSelectedItem(
  166.         DETCallBlockPtr            callBlockPtr,
  167.         long                    itemNumber,
  168.         PackedDSSpec            ***pDsSpec,
  169.         short                    *refNum
  170.     );
  171.  
  172. pascal OSErr                OpenDSSpec(
  173.         DETCallBlockPtr            callBlockPtr,
  174.         PackedDSSpec            *dsSpec
  175.     );
  176.  
  177. pascal OSErr                GetMyFSSpec(
  178.         DETCallBlockPtr            callBlockPtr,
  179.         FSSpec                    *fsSpecPtr
  180.     );
  181.  
  182. pascal OSErr                GetMenuItemRString(
  183.         DETCallBlockPtr            callBlockPtr,
  184.         short                    property,
  185.         long                    parameter,
  186.         RString                    ***result
  187.     );
  188.  
  189. pascal OSErr                RequestSync(
  190.         DETCallBlockPtr            callBlockPtr
  191.     );
  192.  
  193. pascal OSErr                SaveProperty(
  194.         DETCallBlockPtr            callBlockPtr,
  195.         long                    property
  196.     );
  197.  
  198. pascal OSErr                GetCustomViewBounds(
  199.         DETCallBlockPtr            callBlockPtr, 
  200.         short                    property, 
  201.         Rect                    *bounds
  202.     );
  203.  
  204. pascal OSErr                GetPropertyEditable(
  205.         DETCallBlockPtr            callBlockPtr,
  206.         short                    property,
  207.         Boolean                    *isEditable
  208.     );
  209.                                  
  210. pascal OSErr                SetPropertyEditable(
  211.         DETCallBlockPtr            callBlockPtr,
  212.         short                    property,
  213.         Boolean                    isEditable
  214.     );
  215.                                  
  216. #endif    /* __DETUtilities__    */
  217.